pub fn convert_base(num_str: &str, to_base: u32) -> String {
    // Extract the number and its base from the input string
    let parts: Vec<&str> = num_str.trim_end_matches(')').split('(').collect();
    let number = parts[0];
    let from_base = parts[1].parse::<u32>().expect("Invalid base");

    // Convert the number from the original base to base 10
    let num_in_base10 = u32::from_str_radix(number, from_base).expect("Invalid number for the given base");

    // Convert the base 10 number to the target base
    let mut result = String::new();
    let mut n = num_in_base10;

    while n > 0 {
        let remainder = n % to_base;
        result.push(std::char::from_digit(remainder, to_base).expect("Invalid digit for the base"));
        n /= to_base;
    }

    if result.is_empty() {
        result.push('0');
    }

    result.chars().rev().collect()
}